//
//  MYXchatViewController.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/11/15.
//  Copyright © 2017年 hbjApple. All rights reserved.
//

#import "MYXchatViewController.h"
#import "MYXchatCell.h"
#import "JXTActionSheet.h"

static NSString *const MYXchatCellIdentifier = @"MYXchatCell";

@interface MYXchatViewController ()<UITableViewDataSource, UITableViewDelegate, UIGestureRecognizerDelegate,UIActionSheetDelegate,UINavigationControllerDelegate,UIAlertViewDelegate,JXTActionSheetDelegate>
@property(nonatomic, strong)UITableView *tableView;
@property (nonatomic, strong)NSMutableArray *dataArr;

@end

@implementation MYXchatViewController

-(NSMutableArray *)dataArr
{
    if (!_dataArr) {
        _dataArr = [NSMutableArray array];
    }
    return _dataArr;
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view addSubview:self.tableView];
     [self.tableView registerNib:[UINib nibWithNibName:MYXchatCellIdentifier bundle:nil] forCellReuseIdentifier:MYXchatCellIdentifier];
}
- (UITableView *)tableView
{
    if (_tableView == nil) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, -20, WIDTH, HEIGHT+20) style:UITableViewStyleGrouped];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.backgroundColor = [UIColor whiteColor];
        _tableView.dataSource = self;
        _tableView.delegate = self;
        
    }
    return _tableView;
}

#pragma mark - tableview datasource and delegate

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 5;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MYXchatCell *MYXchatCe = (MYXchatCell *)[tableView dequeueReusableCellWithIdentifier:MYXchatCellIdentifier];
    MYXchatCe.selectionStyle = UITableViewCellSelectionStyleNone;
   
    return MYXchatCe;
    
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    return 51;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    // 退出登陆
    JXTActionSheet *actionSheet = [[JXTActionSheet alloc] initWithTitle:@"移出黑名单" buttonTitles:[[NSArray alloc] initWithObjects:@"删除黑名单", nil] redButtonIndex:0 delegate:self];
    actionSheet.tag = 10001;
    [actionSheet show];

}

- (void)actionSheet:(JXTActionSheet *)actionSheet didClickedButtonAtIndex:(NSInteger)buttonIndex
{
    if (actionSheet.tag == 10001) {
        if (buttonIndex == 0) {
           
        }
    }
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
